﻿@model Student.DTO.AccountDTO

@{
    ViewData["Title"] = "Create";
    Layout = "~/Views/Shared/_FormLayout.cshtml";
}

<style>
    .control-label {
        justify-content: flex-end !important;
    }
</style>

<div class="row">
    <div class="col-sm-12">
        <form enctype="multipart/form-data" method="post" asp-action="Save">
            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
            <div class="form-group form-inline my-sm-1">
                <label asp-for="UserName" class="control-label col-sm-3"></label>
                <input asp-for="UserName" class="form-control col-sm-9" placeholder="请输入账号" />
                <span asp-validation-for="UserName" class="text-danger offset-sm-3 my-sm-1"></span>
            </div>
            <div class="form-group form-inline my-sm-1">
                <label asp-for="PassWord" class="control-label col-sm-3"></label>
                <input asp-for="PassWord" class="form-control col-sm-9" placeholder="请输入密码（缺省密码:123456）" />
                <span asp-validation-for="PassWord" class="text-danger offset-sm-3 my-sm-1"></span>
            </div>
            <div class="form-group form-inline my-sm-1">
                <label asp-for="ConfirmPassword" class="control-label col-sm-3"></label>
                <input asp-for="ConfirmPassword" class="form-control col-sm-9" placeholder="请再次输入密码" />
                <span asp-validation-for="ConfirmPassword" class="text-danger offset-sm-3 my-sm-1"></span>
            </div>
            <div class="form-group form-inline my-sm-1">
                <label asp-for="Type" class="control-label col-sm-3"></label>
                <select asp-for="Type" asp-items="Html.GetEnumSelectList<EnumAccountType>()" class="custom-select col-sm-9"></select>
                <span asp-validation-for="Type" class="text-danger offset-sm-3 my-sm-1"></span>
            </div>
            <div class="form-group form-inline my-sm-1">
                <label asp-for="Name" class="control-label col-sm-3"></label>
                <input asp-for="Name" class="form-control col-sm-9" placeholder="请输入昵称" />
                <span asp-validation-for="Name" class="text-danger offset-sm-3 my-sm-1"></span>
            </div>
            <div class="form-group form-inline my-sm-1">
                <label asp-for="Status" class="control-label col-sm-3"></label>
                <select asp-for="Status" asp-items="Html.GetEnumSelectList<EnumStatus>()" class="custom-select col-sm-9"></select>
                <span asp-validation-for="Status" class="text-danger offset-sm-3 my-sm-1"></span>
            </div>
            <span style="color: firebrick;
        word-break: break-all;
    " class="text-danger offset-sm-3">@Html.ValidationMessage("error")</span>
            <div class="form-group">
                <input type="submit" value="保存" class="btn btn-primary offset-sm-3" />
            </div>

        </form>
    </div>
</div>

@section Scripts {
    @{
        await Html.RenderPartialAsync("_ValidationScriptsPartial");
        await Html.RenderPartialAsync("_FileinputScriptsPartial");
    }

<script type="text/javascript">
        $(document).ready(function () {
            var error = '@Html.ValidationMessage("error")';
            if ($(error).text() != '') {
                parent.hg.msg(error);
            }
        });
</script>
}
